From 7f21016a22a3f28f0ef8aba35f29a81b0cc2d5c5 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Thu, 6 Apr 2006 16:41:53 +0100 Subject: [PATCH] Use machine_halt() where it makes sense, to halt all processors rather than just the current one. Signed-off-by: Keir Fraser --- xen/arch/x86/shutdown.c | 2 +- xen/arch/x86/traps.c | 4 ++-- xen/arch/x86/x86_32/traps.c | 4 ++-- xen/arch/x86/x86_64/traps.c | 4 ++-- xen/drivers/char/console.c | 1 + 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86/shutdown.c b/xen/arch/x86/shutdown.c index e3cd61085a..97b41a94ca 100644 --- a/xen/arch/x86/shutdown.c +++ b/xen/arch/x86/shutdown.c @@ -44,7 +44,7 @@ static inline void kb_wait(void) void __attribute__((noreturn)) __machine_halt(void *unused) { for ( ; ; ) - safe_halt(); + __asm__ __volatile__ ( "hlt" ); } void machine_halt(void) diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 2856f75a0c..72272f30ca 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -318,8 +319,7 @@ asmlinkage void fatal_trap(int trapnr, struct cpu_user_regs *regs) console_force_lock(); /* Wait for manual reset. */ - for ( ; ; ) - __asm__ __volatile__ ( "hlt" ); + machine_halt(); } static inline int do_trap(int trapnr, char *str, diff --git a/xen/arch/x86/x86_32/traps.c b/xen/arch/x86/x86_32/traps.c index f0dc661821..d99fecdae9 100644 --- a/xen/arch/x86/x86_32/traps.c +++ b/xen/arch/x86/x86_32/traps.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -180,8 +181,7 @@ asmlinkage void do_double_fault(void) console_force_lock(); /* Wait for manual reset. */ - for ( ; ; ) - __asm__ __volatile__ ( "hlt" ); + machine_halt(); } unsigned long do_iret(void) diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c index fcc188364b..f7dd3e939f 100644 --- a/xen/arch/x86/x86_64/traps.c +++ b/xen/arch/x86/x86_64/traps.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -166,8 +167,7 @@ asmlinkage void do_double_fault(struct cpu_user_regs *regs) console_force_lock(); /* Wait for manual reset. */ - for ( ; ; ) - __asm__ __volatile__ ( "hlt" ); + machine_halt(); } void toggle_guest_mode(struct vcpu *v) diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index df4706bcb2..948000c743 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -520,6 +520,7 @@ void console_force_unlock(void) { console_lock = SPIN_LOCK_UNLOCKED; serial_force_unlock(sercon_handle); + console_start_sync(); } void console_force_lock(void) -- 2.30.2